require_relative 'tlv'
require_relative 'tag'

module SmppClient

  module Pdu

    module Tlv

      # The ms_availability_status parameter is used in the alert_notification
      # operation to indicate the availability state of the MS to the ESME.
      #
      # If the SMSC does not include the parameter in the alert_notification
      # operation, the ESME should assume that the MS is in an “available” state.

      class MsAvailabilityStatus < Tlv

        attr_reader :value

        def initialize(arg)
          if arg.kind_of? ByteBuffer
            super(arg)
            @value = arg.remove_byte
          else
            super(Tag::MS_AVAILABILITY_STATUS)
            @value = arg
          end
        end

        def value_bytes
          ByteBuffer.new.append_byte(value).bytes
        end

      end

    end

  end

end